xen/page_alloc: Cover memory unreserved after boot in first_valid_mfn
authorJulien Grall <julien.grall@arm.com>
Fri, 29 Sep 2017 20:16:21 +0000 (13:16 -0700)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 29 Sep 2017 20:22:52 +0000 (13:22 -0700)
commitec6d9023e1f54cdccbf2e4c63cf947f1be2b1e8e
tree02ba0182b7cc1d15ad6be8aff37c4c69e82ce1c6
parentb7ed331353a14f43f53eaf6a3a543ec8385193a3
xen/page_alloc: Cover memory unreserved after boot in first_valid_mfn

On Arm, some regions (e.g Initramfs, Dom0 Kernel...) are marked as
reserved until the hardware domain is built and they are copied into its
memory. Therefore, they will not be added in the boot allocator via
init_boot_pages.

Instead, init_xenheap_pages will be called once the region are not used
anymore.

Update first_valid_mfn in both init_heap_pages and init_boot_pages
(already exist) to cover all the cases.

This is XSA-245.

Signed-off-by: Julien Grall <julien.grall@arm.com>
[Adjust comment, added locking around first_valid_mfn update]
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Reported-and-Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/common/page_alloc.c